const { override, fixBabelImports, addLessLoader, addWebpackAlias, addDecoratorsLegacy  } = require('customize-cra');
const { resolve } = require('path');

module.exports = override(
  // antd按需引入
  fixBabelImports('import', {
    libraryName: 'antd',
    libraryDirectory: 'es',
    // style: 'css',
    style: true //开启主题色则'css'改为true
  }),
  // 主题色是基于less的
  addLessLoader({
    javascriptEnabled: true,
    modifyVars: { '@primary-color': '#1DA57A' }
  }),
  // src别名
  addWebpackAlias({
    '@': resolve('src')
  }),
  // 开启装饰器: 真正支持装饰器语法
  addDecoratorsLegacy()
);
